package com.example.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.entity.Student;
import com.example.mapper.StudentMapper1;
import com.example.mapper.StudentMapper2;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author jukg
 * @date 2025/04/16 14:02
 * @description
 */
@Service
public class StudentService {
    @Resource
    private StudentMapper1 studentMapper1;
    @Resource
    private StudentMapper2 studentMapper2;

    @DS("master")
    public List<Student> query(){
        return studentMapper1.query();
    }

    @DS("slave")
    public List<Student> query2(){
        return studentMapper2.query();
    }
}
